﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace FinancialManagement.Infrstructre
{
    public interface IRepository<T> where T : class,new()
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task<int> AddAsync(T t);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task<int> UpdateAsync(T t);
        /// <summary>
        /// 过去所有数据
        /// </summary>
        /// <returns></returns>
        Task<ISugarQueryable<T>> GetAllAsyns();
        /// <summary>
        /// 查询所有数据没有异步
        /// </summary>
        /// <returns></returns>
        List<T> QueryAll();
    
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task<int> RemoveAsync(List<T> t);
    }
}
